export default class RouterUtil {
  static getRouteData(routes,menus) {
    for (let i = 0; i < menus.length; i++) {
      let menu = menus[i];

      let children = menu.children;
      if (children !== null && children !== undefined && children.length !== 0) {
        this.getRouteData(routes,children);
        continue;
      }

      let componentName = menu.component;
      componentName = componentName.substring(2);
      let route = {
        path: menu.path,
        name: menu.name,
        meta: menu.meta,
        component: () => import('../' + componentName)
      };

      routes.push(route);
    }
  }
}
